using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

namespace Shara
{
    public class FlyAway : MonoBehaviour
    {
        // Start is called before the first frame update
        [SerializeField]
        float m_fTime = 1;
        [SerializeField]
        float m_fDis = 200;
        void OnEnable()
        {
            transform.localPosition = Vector3.zero;
            GetComponent<Image>().color = Color.white;
            transform.DOMoveY(transform.position.y + m_fDis, m_fTime).SetEase(Ease.OutBack).OnComplete(() => gameObject.SetActive(false));
            GetComponent<Image>().DOColor(new Color(1, 1, 1, 0), m_fTime);
        }

        // Update is called once per frame
        void Update()
        {

        }
    }
}